Field of the Invention
The present invention relates to a processing device which obtains distance information of a subject from a photographed image, and an image pickup device provided with the processing device. The present invention also relates to a processing method for obtaining distance information of a subject from a photographed image.
Description of the Related Art
As a method for obtaining, from a two-dimensional image obtained by an image pickup device, a distance of a subject in the image in a depth direction, a depth from defocus (DFD) system as disclosed in Japanese Patent Laid-Open No. 01-167610 has been proposed. In the DFD system, a plurality of images having different blur degrees are obtained by controlling photographing conditions (which is also referred to as photographing parameters) of an imaging optical system. Then a blur size and a blur correlation quantity among the plurality of images are calculated using distance measuring pixels and peripheral pixels thereof. Since the blur size and the blur correlation quantity change depending on a distance from an in-focus position of an imaging optical system to a subject, the distance from the in-focus position of the imaging optical system to the subject is obtained by using the correlation quantity.
Japanese Patent Laid-Open No. 2010-016743 discloses a distance measuring apparatus which calculates a subject distance from a blur correlation quantity calculated for each area to be processed using the DFD system. In the apparatus, a weighting factor is set to the blur correlation quantity of every pixel unit for each pixel in the area to be processed and the blur correlation quantity is weight averaged in accordance with the weighting factor.
In an imaging optical system of a typical image pickup device, there are aberration, such as a curvature of field, spherical aberration, coma aberration and axial chromatic aberration, and thus focus positions differ depending on image height. In such a distance measuring method as the DFD system in which a difference in blur is used, since the distance information based on the focus position of the imaging optical system is obtained, an error in accordance with the image height is caused also in the distance information if the focus positions differ depending on the image height.
In Japanese Patent Laid-Open No. 01-167610 and Japanese Patent Laid-Open No. 2010-016743, it is not mentioned that an error in distance information is caused due to offset of focus positions in accordance with image height of the imaging optical system.